home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / UTILITY / CT43C.ARJ / CT43C.DOC < prev    next >
Text File  |  1992-07-09  |  17KB  |  355 lines

  1. Program:    Cache Test
  2. Version:    4.3c
  3. Author:     George Spafford
  4. Date:       July 9, 1992
  5.  
  6. Summary:
  7.  
  8. This program is designed to help a user evaluate the impacts
  9. of a cache, or the changes to an existing cache, on a drive's
  10. performance.  
  11.  
  12. Furthermore, with users' increasingly using caches during a 
  13. variety of tasks, it is important to find the optimal cache 
  14. settings given the task at hand.  Whereas a word processor 
  15. might make heavy usage of sequential files, a database 
  16. might make heavy usage of random access files.  With this 
  17. in mind, the memory requirements, sectors cached, write 
  18. delays and so forth have many possible variations.
  19.  
  20. By default, Cache Test creates a 10,000 record sequential file
  21. using 32 byte records and then a 10,000 record random access file
  22. that again uses 32 byte record lengths.  Note, even if the default is
  23. changed, any sample string length will be increased by two bytes by
  24. the addition of a CR/LF.  You may want to compensate accordingly if
  25. you wish to be exact in your measurements.  The sample record size
  26. indicator displays the TRUE sample string size.
  27.  
  28. This program uses BIOS to do all of its reads and writes, 
  29. so any hardware or software cache should be able to get 
  30. some good "hits."  In attempt to flush caches during the 
  31. test, files are frequently opened and closed.
  32.  
  33. All of the times that this program writes are the result of
  34. subtracting the beginning time from the ending time.  Nothing
  35. fancy, so the values are relatively accurate.  Note, if you do
  36. some math to compute access times per record, you will run into
  37. the age old problem of significant digits.  This program only accounts
  38. for one decimal location (0.1).  As such, if you try to take the
  39. timings out to 1/100th of a second, the resulting error factor can be
  40. quite high, relatively speaking that is.
  41.  
  42. Remember, if an outcome is in doubt, use a larger sample size!  That is
  43. to say, increase the number of bytes that are written to the disk.  The
  44. other alternative is to increase the number of sample passes.  You'll
  45. notice that results begin to stabilize with file sizes of 5000 records,
  46. 32 bytes, and 5 passes.
  47.  
  48.           
  49. A few definitions:
  50.  
  51.       "ButterFly Test"     The middle record is read and then a
  52.                            record is alternatingly and read in each
  53.                            direction from the middle.  Say you have
  54.                            a 100 record file, the read order would
  55.                            be 50,49,51,48,52,47,53 . . . and so on.
  56.                            
  57.       "CR/LF"              Carriage Return and Line Feed.  Decimal 13
  58.                            and 10 respectively (CHR$(13),CHR$(10)).  These
  59.                            two characters are used as "end of record"
  60.                            delimiters.  As such, they are included in the
  61.                            byte count when a record is written.  If the
  62.                            sample string is 10 bytes, these two additional
  63.                            bytes are added to the end resulting in a total
  64.                            of 12 bytes.  Bear this in mind if you want exact
  65.                            values.
  66.                                
  67.       "Crescendo Read"     Records are read alternatingly in from the end of
  68.                            the file and the beginning file.  This is to say,
  69.                            record 1, 10000, 2, 9999, 3, 9998, 4, 9997 etc.
  70.                            Okay, Okay ... so my definition of Crescendo is
  71.                            backwards... They didn't spell the Macintosh
  72.                            correctly either.
  73.  
  74.       "Random Read/Write"  Random functions generate independent random
  75.                            reads and writes.
  76.  
  77.       "Read-by-1"          A random access file's records are being accessed
  78.                            one at a time.
  79.  
  80.       "Stepping-by-10"     A random access file's records are being accessed
  81.                            on every 10th record.
  82.  
  83.       "Write-by-10"        A random access file's records are being updated
  84.                            on every 10th record.
  85.  
  86.       "Overall"            This is the total time of all tests AND file
  87.                            deletes.  So, it might not reflect the sum
  88.                            of all tests exactly, but it should be very
  89.                            close.
  90.  
  91.       I just wanted to make those meanings a little clearer.
  92.  
  93.       ******************************************************************
  94.  
  95.           Usage of this program is:
  96.  
  97.           CT  </D:d><F:bbb></N:nnn></S></R></B></?>
  98.  
  99.             CT by itself will test the active drive that it is on with
  100.             the default record length of 32 bytes and 10,000 records.
  101.                             
  102.         Explanation of switches:
  103.  
  104.         /D:d    This specifies "d" as the drive to be tested.
  105.  
  106.         /F:b    This specifies the number of fixed bytes per record.
  107.                 It must be between 1 and 32,765.  The default is 32 bytes.
  108.                 Use this with the /N:n switch to enhance your testing.
  109.                 (Because of CR/LF usage in the file structure, the logical
  110.                 limit for a user input is 32,765 and not the allowable
  111.                 32,767)
  112.  
  113.         /L:f    This is where you want your summary screen to be logged to.
  114.                 "f" can be a device or a file name.
  115.                 To go to the printer, a user might have:   /L:prn or /L:lpt2
  116.                 To go to a file, a user might have /L:ct.log.  If you log
  117.                 the data to a file, by default it is appended to the file if
  118.                 the file already exists.  If you want to create the log file
  119.                 fresh each time, use the /C switch also.
  120.  
  121.         /N:n    This specifies the number of test records.
  122.                 Note, the only limitation here is the available space 
  123.                 on your test drive.  You can also go as small as
  124.                 you want, but you will reach a point where your test
  125.                 will lose its validity.
  126.                 The default value, if this switch is not used, is
  127.                 10,000 records.
  128.  
  129.         /P:ppp  This specifies the number of test passes.  In other words,
  130.                 the number of times that the test will repeat.  If this
  131.                 option is > 1 then when the passes have all completed,
  132.                 a Summary screen appears with average sequential, random
  133.                 and total times.  If there is only one pass, then the
  134.                 summary screen will not be displayed
  135.  
  136.         /B      Test both sequential and random access records.
  137.         /C      Creates log files rather than appending data if the
  138.                 log file already exists.  This switch has no effect if
  139.                 the data is going to a device rather than a file.
  140.         /R      Test random access records only.
  141.         /S      Test sequential access records only.
  142.         /W      Wait after each screen (pause).
  143.         /X      Exclude run-time screen counters.
  144.  
  145.  
  146. Suggestions:
  147.  
  148. You might want to set up a batch file that purges your cache
  149. before CT is run.  This will allow the cache to have a little
  150. fairer test, as opposed to starting out partially full.
  151. Also, if you are interested in the actual hits on your cache, most
  152. cache programs (PC-CACHE and NCACHE for sure) have status switches
  153. that allow you to see the results from the cache's point of view.
  154.  
  155. The test file is written in the root directory of the target drive.
  156. The file name is TEST$$CT.SPD.  If the critter appears, don't panic!
  157. It probably didn't get deleted because of an interrupted test.
  158.  
  159. While it was never the intention of Cache Test to allow cross-machine
  160. comparisons, I have decided to allow the counters to be disabled using
  161. the /X switch.  On my system, an identical test with the counters
  162. disabled was 42% faster than with the counters enabled.   If you want
  163. to actually test the drive/cache subsystem without the video bottleneck,
  164. use this switch.
  165.  
  166. HISTORY:
  167.  
  168.       v4.3c 07/09/92 pm
  169.  
  170.             Heck ... I can't win for losing.  I have spent several hours now
  171.             debugging the variable overflow problem.  I believe that they
  172.             have all been eliminated now.
  173.  
  174.             To say "sorry," you can have VT 1.1 also if you choose to register
  175.             (or are already registered to) Cache Test - this just applies to
  176.             people registering 4.3 or who are already registered now.
  177.             
  178.  
  179.       v4.3b 07/09/92 am
  180.       
  181.             Ooops, I switched to explicit variable typing and ran
  182.             into a problem when file sizes exceeded the limit of an
  183.             integer variable (32,767) and the program bombed.  It's all
  184.             set now.      
  185.  
  186.       v4.3  07/06/92
  187.  
  188.             All screens can now be logged to a file or device.  This
  189.             logging no longer requires that the pass count (/P:) be
  190.             greater than 1.
  191.             Every second data screen (excluding the final summary) has
  192.             a form feed added to it to prevent printing across paper
  193.             perforations when logging to a printer.
  194.             The summary screen now displays the command line that was used.
  195.  
  196.          ** Due to the volume of mail that I am receiving, I am forced to
  197.             stop responding to every piece of mail unless you have questions.
  198.             I'm really sorry for that one folks, but it is seriously taking
  199.             time away from me when I could otherwise be coding.
  200.  
  201.       V4.2  01/10/92
  202.   
  203.             Using the /L: switch, a user can now specify where he/she
  204.             would like the summary screen to go (nice idea Jim).
  205.             Also did a little house cleaning on the program in general.
  206.             Happy New Year everyone.  I would like to thank three people
  207.             especially for all of their tolerance and helpful suggestions:
  208.             Tim Aright of Queued Access, Wayne Keeter of Wayne's World,
  209.             and Jonathan Fisk.
  210.  
  211.       V4.1  11/13/91
  212.   
  213.             Well Owen, I thought about it.  The screen counters can
  214.             now be disabled using the /X switch on the command line.
  215.             Note, there are many variables that affect cache performance.
  216.             It was never my intention to test cache performance across
  217.             machines.  BUT, it is a good idea to allow the user the
  218.             ability to decide for his/her self as to whether they want
  219.             to or not.  If you disable the counters, there can be some
  220.             long pauses - especially for the Random Read/Write test - so
  221.             be patient.  CT now has the extremes - a lot of counters or
  222.             none at all ;-)
  223.  
  224.       V4.0  10/29/91
  225.   
  226.             Whew... This one has quite a few updates:
  227.  
  228.             1.  COLOR (makes things a lot easier to read).
  229.             2.  Tracking of timer ticks has been tightened down.
  230.             3.  Created the ability to perform a number of tests
  231.                 and then present a summary screen with averages
  232.                 using the /P:ppp switch.
  233.             4.  /W switch added for pausing after screens.
  234.  
  235.  
  236.       V3.5  9/03/91
  237.  
  238.             In response to Mike Focke's request for counters in the
  239.             crescendo and butterfly tests, I have again enabled them.
  240.             And Mike, thanks for the suggestions ;-)
  241.  
  242.       V3.1  8/26/91
  243.  
  244.             The timing routine is now based on the presence of 18.2
  245.             clock ticks per one second.  The 100ths decimal location is
  246.             still weak, but improved.
  247.  
  248.       V3.0  7/10/91
  249.  
  250.             Well, I accessed the BIOS segment for clock ticks to create
  251.             the decimal level counters.  The second decimal place is
  252.             weak in terms of its accuracy, but I decided to leave it in.
  253.             For those of you worried about significant digits, the 
  254.             algorithm used for this uses 18 clock ticks to generate one
  255.             second of time.
  256.  
  257.             The test records are now 32 bytes total.
  258.  
  259.             Output screen formatting is improved.
  260.  
  261.             If the program is invoked without any parameters, it executes
  262.             on the active drive with a 10,000 record test made up of 32
  263.             bytes.  All user input now occurs on the command line through
  264.             the use of switches.          
  265.  
  266.       V2.6  5/24/91
  267.  
  268.             I honestly did not intend another update so soon.  It was
  269.             pointed out to me that the file structure that I had been
  270.             using was variable.  As such, it made ratio comparisons
  271.             somewhat difficult.  Now, the default fixed record length
  272.             is 32 bytes (the test record count is still 10,000).  The
  273.             user can specify the record length by using the /F:bbbbb
  274.             switch.  "bbbbb" must be between 0 and 32,765.   Since the
  275.             values are now fixed, a user can do a little math (remember
  276.             that subject folks??) and discern the records per second and
  277.             so forth.  Do note, that two bytes are added to the test string
  278.             in the files (CR/LF to be exact) that is why the maximum byte
  279.             size that a user can specify is 32,765 and not the 32,767 legal
  280.             default limit.
  281.               
  282.       V2.5  5/22/91
  283.  
  284.             1.  An actual test file byte size field has been added.
  285.                 This should allow users to track the actual sizes of
  286.                 the test records being written.
  287.             2.  Some users suggested that truly random reads and writes
  288.                 should be added.  This serves to get away from any form
  289.                 of sequentialized data.
  290.             3.  Again, more cosmetic touchups.
  291.  
  292.       V2.0  5/16/91
  293.  
  294.             Due to some users having limited drive space, switches
  295.             were added to allow for different size tests to 
  296.             occur.  I was somewhat hesitant to do this because it
  297.             negated the ability to call results "standard," but 
  298.             what really is standard?
  299.  
  300.             Switches were also added to allow users to select 
  301.             what tests they want to run.  For now, all that can 
  302.             be specified is whether or not to run all tests, 
  303.             sequential tests only, or random tests only.
  304.  
  305.             The ButterFly test was also added in an attempt to 
  306.             give look-ahead caches a hard time.  Some of the 
  307.             caches that use a FIFO method of purging will have a 
  308.             heck of a time with this one.
  309.  
  310.             Added timers/cleared up timers for the sequential and 
  311.             overall tests.  Also speaking of timers, to avoid 
  312.             slowing down some routines, I have removed some of 
  313.             the video effects that were for the user's benefit 
  314.             only.
  315.  
  316.             Special thanks to Jonathan Fisk for all of his 
  317.             suggestions and debugging efforts.
  318.  
  319.             Special thanks also go out to Tim Akright, the sysop 
  320.             of Queued Access for all of his support.
  321.  
  322.  
  323.       V1.0  5/10/91
  324.  
  325.             Well, I released it.  That pretty well sums it up.
  326.  
  327.  
  328.         I hope this program helps you evaluate some of your problems
  329.         or even makes some solutions/benefits clear.  This program is
  330.         released as shareware.  Its price is $5 for each concurrently
  331.         used copy.  If you have any suggestions or comments, I'd REALLY
  332.         like to hear those too.
  333.  
  334.                 Sincerely,
  335.  
  336.                 George Spafford
  337.                 3001 LakeShore Drive, #329
  338.                 St. Joseph, MI 49085
  339.  
  340.         Data:  (616) 468-5026  Queued Access BBS 14.4Kb USR Dual HST
  341.                                Sysop:  Tim Akright
  342.  
  343.         And now for the unpleasantries:
  344.  
  345.         Code CopyRight:  1992 - George Spafford
  346.         
  347.         CT IS DISTRIBUTED AS IS.  THE AUTHOR (GEORGE SPAFFORD) MAKES NO
  348.         WARRANTY OF ANY KIND, EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
  349.         TO WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE,
  350.         WITH RESPECT TO THIS SOFTWARE AND DOCUMENTATION. IN NO EVENT SHALL
  351.         THE AUTHOR BE LIABLE FOR ANY DAMAGES, INCLUDING LOST PROFITS, LOST
  352.         SAVINGS, OR ANY OTHER INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
  353.         OUT OF THE USE OF OR THE INABILITY TO USE THIS PROGRAM.
  354.         ----------------------------------------------------------------
  355.